package com.power.sifa.statistics.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  每日记录记事本实体类
*/

@Entity
@ApiModel(value="每日记录记事本")
@Data
@Table(name="Apl_note_book",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_note_book.Apl_note_bookPK.class) 用于复合组件
public class Apl_note_book extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "nanoid")
    private String id;

    @ApiModelProperty(value = "用户id")
    private String userid;

    @ApiModelProperty(value = "用户名称")
    private String username;

    @ApiModelProperty(value = "记录时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date notetime;

    @ApiModelProperty(value = "记录文本")
    private String notetext;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("userid", this.getUserid());
        map.put("username", this.getUsername());
        map.put("notetime", this.getNotetime());
        map.put("notetext", this.getNotetext());
        map.put("sort", this.getSort());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_note_bookPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_note_bookPK pk = (Apl_note_bookPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}